package be.stijn.gdocs;

import java.io.File;
import java.io.IOException;

import com.google.gdata.util.AuthenticationException;
import com.google.gdata.util.ServiceException;

public interface GDocsService {

    /**
     * Login to Google.
     * 
     * @param user
     *            The Google user account
     * @param password
     *            The password of the Google user account.
     * @throws AuthenticationException
     *             Will be thrown when logging in failed.
     */
    public abstract void login(String user, String password) throws AuthenticationException;

    /**
     * Setup the proxy server who needs to be used to perform the http request to Google.
     * 
     * @param host
     *            The hostname of the proxy server.
     * @param port
     *            The port number of the proxy server.
     */
    public abstract void setProxy(String host, String port);

    /**
     * Setup a authenticated proxy server who needs to be used to perform the http request to Google.
     * 
     * @param host
     *            The hostname of the proxy server.
     * @param port
     *            The port number of the proxy server.
     * @param user
     *            The username to authenticate with the proxy server.
     * @param password
     *            The password used to authenticate with the proxy server.
     */
    public abstract void setProxy(String host, String port, String user, String password);

    /**
     * Retrieve all the files from the logged in Google account and put them in the target folder.
     * 
     * @param targetFolder
     *            The target folder to put the retrieved files in.
     * @throws IOException
     * @throws ServiceException
     */
    public abstract void getFiles(File targetFolder) throws IOException, ServiceException;

    public void uploadFiles(File folder) throws IOException, ServiceException;

}